package week03.week031;

import java.util.Arrays;
import java.util.Scanner;


public class Main3 {


    private static Scanner in;

    public static void main(String[] args){
        in=new Scanner(System.in);
        while(true)
        {
            Rectangle[] rectangle=new Rectangle[2];
            rectangle[0]=new Rectangle(in.nextInt(),in.nextInt());
            rectangle[1]=new Rectangle(in.nextInt(),in.nextInt());
            Circle[] circles=new Circle[2];
            circles[0]=new Circle(in.nextInt());
            circles[1]=new Circle(in.nextInt());
            System.out.println(rectangle[0].getPerimeter()+rectangle[1].getPerimeter()+
                    circles[0].getPerimeter()+circles[1].getPerimeter());
            System.out.println(rectangle[0].getArea()+rectangle[1].getArea()+
                    circles[0].getArea()+circles[1].getArea());
            System.out.println(Arrays.deepToString(rectangle));
            System.out.println(Arrays.deepToString(circles));
        }


    }

}


class Rectangle{
    private int width;
    private int length;

    public Rectangle(int width,int length)
    {
        this.width=width;
        this.length=length;
    }

    public int getPerimeter()
    {
        return (width+length)*2;
    }

    public int getArea(){
        return width*length;
    }

    @Override
    public String toString() {
        return "Rectangle [" +
                "width=" + width +
                ", length=" + length +
                ']';
    }
}

class Circle{
    private int radius;
    private double i;

    public Circle(int radius)
    {
        this.radius=radius;
    }

    public int getPerimeter()
    {
        i=Math.PI*2*radius;return (int) i;
    }

    public int getArea(){
        i=Math.PI*radius*radius;return (int) i;
    }

    @Override
    public String toString() {
        return "Circle [" +
                "radius=" + radius +
                ']';
    }
}
